fix: handle race condition when joining first storage node#782
Open
himax16 wants to merge 1 commit intocanonical:mainfrom
Open
fix: handle race condition when joining first storage node#782himax16 wants to merge 1 commit intocanonical:mainfrom
himax16 wants to merge 1 commit intocanonical:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a stall when the first storage node joins a cluster by allowing an initial non-blocking MicroCeph deploy, redeploying the control plane to enable Ceph integrations, and then redeploying MicroCeph in blocking mode.
Changes:
- Add a
waitflag toDeployMachineApplicationStep(and plumb it throughDeployMicrocephApplicationStep) to optionally skipwait_application_ready. - Update the local provider
join()flow to detect the first storage node and perform a non-blocking MicroCeph deploy → control plane redeploy → blocking MicroCeph redeploy sequence. - Remove the prior redundant
DeployCinderVolumeApplicationStepexecution in the first-storage-node path (now executed once after the branching logic).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
sunbeam-python/sunbeam/steps/microceph.py |
Adds wait parameter to MicroCeph deploy step and forwards it to the base deploy step. |
sunbeam-python/sunbeam/provider/local/commands.py |
Adjusts local join plan for first storage node to avoid waiting deadlock and reorganizes MicroCeph/control-plane deployment order. |
sunbeam-python/sunbeam/core/steps.py |
Introduces wait behavior in DeployMachineApplicationStep.run() to optionally skip application readiness waiting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes-Bug: #2149906 Signed-off-by: Himawan Winarto <himawan.winarto@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When adding the first storage node to the cluster that previously contains no storage nodes, the join operation will stall.
This is because
DeployMicrocephApplicationStepwaits for the MicroCeph charm to be active, while it requirestraefik-route-rgwrelation to register with Keystone. The relation does not exist because it requiresenable-ceph: Truein the control plane.We fix by allowing the first MicroCeph deployment to be non-blocking and then redeploying the control plane. This will establish the required relations and allow us to do blocking redeployment of the MicroCeph charm.
Also removed the redundant
DeployCinderVolumeApplicationStep.Closes-Bug: #2149906